package team.future.joke.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;

import team.future.joke.entity.JokeStore;

/**
 * Title: jokeStoreDaoImpl.java<br>
 * Description: <br>
 * Copyright (c) 未来工作室版权所有 2015    <br>
 * Create DateTime: 2015年9月16日 下午12:34:06 <br>
 * @author futurezhu
*/
@Service("jokeStoreDao")
public class jokeStoreDaoImpl extends BaseMongoDaoImpl<JokeStore> {

	@Autowired
	private MongoOperations mongoTemplate;

	@Override
	public void insertObject(JokeStore store) {
		mongoTemplate.insert(store);
	}

	@Override
	public void deleteObject(Query query) {
		mongoTemplate.remove(query, JokeStore.class);
	}

	@Override
	public List<JokeStore> getObjectList(Query query) {
		return mongoTemplate.find(query, JokeStore.class);
	}
}
